package com.cxf.cxforderdemo.controller;

import com.cxf.cxforderdemo.repository.Order;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping
public class OrderController {

    @GetMapping("/order/{orderId}")
    public Order queryOrder(@PathVariable("orderId") String orderId){
        System.out.println("收到请求..."+orderId);
        Order order = new Order();
        if("1111".equals(orderId)){
            order.setOrderId("1111");
            order.setProductId("2222");
            order.setProductPrice("19.9");
            order.setProductName("玻璃杯");
        }
        return order;
    }

}
